<?php

	set_time_limit(0);
	error_reporting(E_ALL^E_NOTICE);
	require_once("config.php");
	$link=mysql_connect($db_host,$db_user,$db_pass);
	mysql_select_db($db_name);
	mysql_query("set names utf8");
	function desc_table($table)
	{
		$sql = 'DESC '.$table;
		$result = mysql_query($sql);
		$str = '';
		while($row = mysql_fetch_array($result,MYSQL_ASSOC))
		{
			$str .= '\''.$row['Field'].'\''."\t\t\t".'=>\'\','."\r\n";
		}
		$str = rtrim($str,"\r\n");
		$str = rtrim($str,",");
		file_put_contents('desc.'.$table.'.txt',$str);
	}

	desc_table('ecs_user_account');
?>